package com.icesoft.x.demo;

import java.io.*;
import java.util.ArrayList;
import java.util.List;

import javax.faces.context.FacesContext;
import javax.servlet.ServletContext;

public class ArtShowDAO {
	
	        
	
	 public ArtShowDAO() {
	  
	}
	 
	public List<String> filldata() {
		FacesContext facesContext = FacesContext.getCurrentInstance();
	    ServletContext servletContext = (ServletContext) facesContext.getExternalContext().getContext();
		String path = servletContext.getRealPath("/");
		
	    List<String> images = new ArrayList<String>();
		File dir = new File(path+"/images/100044");
	    String[] chld = dir.list();
	    if(chld == null){
	      System.out.println("Specified directory does not exist");
	      return null;
	    }else{
	    
	      for(int i = 0; i < chld.length; i++){
	        String fileName = chld[i] ; 
	        images.add(new String(chld[i]));
	        
	      }
	      return images;
	    }
	  }
	

}
